﻿using System;
using System.Diagnostics.Contracts;

namespace AppWorks
{
    [ContractClass(typeof(IClockContracts))]
    public interface IClock
    {
        DateTime UtcNow();
    }

    [ContractClassFor(typeof(IClock))]
    internal abstract class IClockContracts : IClock
    {
        public DateTime UtcNow()
        {
            Contract.Ensures(Contract.Result<DateTime>().Kind == DateTimeKind.Utc, "The result should be a UTC date and time.");
            return default(DateTime);
        }
    }
}